﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace WcfService1
{
    // 双工通信
    [ServiceContract(SessionMode=SessionMode.Required, // 会话模式将客户端和服务之间发送的一组消息关联在一起
        CallbackContract = typeof(IService1Callback))] // 指定服务的回调协定接口
    public interface IService1 // 服务接口
    {
        [OperationContract(IsOneWay = true)] // 单向模式
        void SubjectSelectAll();
        [OperationContract(IsOneWay = true)]
        void SubjectInsert(string[] selectedItem);
        [OperationContract(IsOneWay = true)]
        void SubjectUpdate(string[] selectedItem);
        [OperationContract(IsOneWay = true)]
        void SubjectDelete(string selectedItem);
        [OperationContract(IsOneWay = true)]
        void SubjectSelectKeyword(string keyword);

        [OperationContract(IsOneWay = true)] 
        void EventSelectAll();
        [OperationContract(IsOneWay = true)]
        void EventInsert(string[] selectedItem);
        [OperationContract(IsOneWay = true)]
        void EventUpdate(string[] selectedItem);
        [OperationContract(IsOneWay = true)]
        void EventDelete(string selectedItem);
        [OperationContract(IsOneWay = true)]
        void EventSelectKeyword(string keyword);
    }

    public interface IService1Callback // 客户端回调接口，在客户端实现
    {
        [OperationContract(IsOneWay = true)] // 单向模式
        void ShowResults(DataTable dt, int res);
    }
    
}
